﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace MCWorldLibrary
{
    public static class DateTimeExtender
    {
        private static readonly DateTime UnixEpoch =
            new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);

        public static long ToUnixTime(this DateTime dateTime)
        {
            return (long)(dateTime - UnixEpoch).TotalSeconds;
        }
    }
}
